feat: implement pagination on find all team members endpoint #1312
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
findAllTeamMembers
endpoint currently retrieves all team members from the database without any pagination. This could lead to performance issues and increased database load if there are a large number of team members. Implementing pagination will enhance efficiency and scalability.Acceptance Criteria
findAllTeamMembers
endpoint should accept optionalpage
andlimit
query parameters.TeamMemberService.findAllTeamMembers
method should usepage
andlimit
parameters to implement pagination usingskip
andtake
(or equivalent ORM methods).page
andlimit
parameters.page
andlimit
parameters for thefindAllTeamMembers
endpoint.page
andlimit
should be defined (e.g.,page=1
,limit=10
) if the parameters are not provided in the request.Purpose
Implementing pagination for the
findAllTeamMembers
endpoint will improve the performance and scalability of the application by reducing the amount of data retrieved from the database and transmitted over the network. This is especially important when dealing with a large number of team members.Requirements
findAllTeamMembers
method inTeamMemberController
to accept optionalpage
andlimit
query parameters.findAllTeamMembers
method inTeamMemberService
to use thepage
andlimit
parameters to implement pagination usingskip
andtake
.page
andlimit
parameters.findAllTeamMembers
remains intact whenpage
andlimit
parameters are not provided.Screenshots
Before
After
Expected Outcome
The
findAllTeamMembers
endpoint will return a paginated response with a subset of team members based on thepage
andlimit
parameters. The API documentation will be updated to reflect the new parameters, improving performance and scalability.The JSON response should follow a uniform API format: